package com.hyb.Util;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * <p>
 *      Date工具类
 * </p>
 *
 * @author hyb
 * @since 2021-12-29
 */
public class DateUtil {
    public static String getTodayDate(){
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd");

        return dateFormat.format(date);
    }

    public static  String getLocalDate(){
        LocalDate localDate = LocalDate.now();
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        return localDate.format(fmt);
    }
}
